<template>
	<div class="app-container">
		<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
			label-width="68px">
			<el-form-item label="工号" prop="HRID">
				<el-input v-model="queryParams.HRID" placeholder="请输入工号" clearable
					@keyup.enter.native="handleQuery" />
			</el-form-item>
			<el-form-item label="名称" prop="DisplayName">
				<el-input v-model="queryParams.DisplayName" placeholder="请输入名称" clearable
					@keyup.enter.native="handleQuery" />
			</el-form-item>
			<el-form-item>
				<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
				<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
			</el-form-item>
		</el-form>
		<el-row :gutter="10" class="mb8">
			<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
		</el-row>
		
		<el-empty description="暂无用户信息" v-if="queryParams.pageNum == 1 && applycarList.length == 0"></el-empty>
		<el-row v-else>
			<el-table v-loading="loading" :data="applycarList" :border="true">
				<el-table-column label="工号" align="center" prop="hrid" />
				<el-table-column label="姓名" align="center" prop="displayName" />
				<el-table-column label="部门" align="center" prop="ouname" />
				<el-table-column label="联系方式" align="center" prop="mobile" />
				<el-table-column label="岗位" align="center" prop="leaderTitle" />
				<el-table-column label="主管" align="center" prop="supervisorUserName" />
				<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
					<template slot-scope="scope">
						<el-button size="mini" type="text" icon="el-icon-view" @click="jump(scope.row.id)"
							v-hasPermi="['usecar:details:query']">详情
						</el-button>
						<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
							v-hasPermi="['bpmapply:applycar:edit']" v-if="scope.row.isUpdateStatus == 1">修改
						</el-button>
						<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
							v-hasPermi="['bpmapply:applycar:remove']" v-if="scope.row.isDelStatus == 1">取消
						</el-button>
					</template>
				</el-table-column> -->
			</el-table>

			<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
		</el-row>
	</div>
</template>

<script>
	import { userList } from '@/api/identity/identity'
	export default {
		name: 'IdentityUser',
		data() {
			return {
				// 遮罩层
				loading: true,
				// 选中数组
				ids: [],
				// 非单个禁用
				single: true,
				// 非多个禁用
				multiple: true,
				// 显示搜索条件
				showSearch: true,
				// 总条数
				total: 0,
				// 用车申请表格数据
				applycarList: [],
				// 弹出层标题
				title: '',
				// 是否显示弹出层
				open: false,
				openUp: false,
				// 删除标志时间范围
				daterangeStartTime: [],
				// 删除标志时间范围
				daterangeEndTime: [],
				// 查询参数
				queryParams: {
					pageNum: 1,
					pageSize: 10,
					HRID: null,
					DisplayName: null,
					Disabled: 0
				},
				// 表单参数
				form: {},
				params: {
					detailsId: null // 初始化为 null 或者你需要的默认值
					// 其他的参数属性
				},
				btnHandle: false,
				row: {}, // 选中行
			}
		},
		created() {
			this.getList();
		},
		methods: {
			/**
			 * 查询用车申请列表
			 */
			getList() {
				this.loading = true
				userList(this.queryParams).then(response => {
					this.applycarList = response.rows || [];
					this.total = response.total
					this.loading = false
				});
			},
			/**
			 * 表单重置
			 */
			reset() {
				this.form = this.initFormData();
				this.form2 = this.initFormData();
				this.resetForm('form');
				this.resetForm('form2');
			},
			/**
			 * 搜索按钮操作
			 */
			handleQuery() {
				this.queryParams.pageNum = 1
				this.getList()
			},
			/**
			 * 重置按钮操作
			 */
			resetQuery() {
				this.daterangeStartTime = []
				this.daterangeEndTime = []
				this.resetForm('queryForm')
				this.handleQuery()
			}
		}
	}
</script>